package com.ruoyi.common.enums;

public enum TypeEums {
    // 样件
    SAMPLE(0,"样件"),
    // 小批
    SMALL_BATCH(1,"小批"),
    // 批量
    MASS_PRODUCTION(2,"批量");

    private final int value;

    private final String description;

    TypeEums(int value,String description) {
        this.value = value;
        this.description = description;
    }


    /**
     * 获取值
     * @return
     */
    public int getValue() {
        return value;
    }

    public String getDescription() {
        return description;
    }

    /**
     * 根据值获取枚举项
     * @param value
     * @return
     */
    public static TypeEums fromValue(int value) {
        for (TypeEums TypeEums : TypeEums.values()) {
            if (TypeEums.getValue() == value) {
                return TypeEums;
            }
        }
        throw new IllegalArgumentException("Unexpected value: " + value);
    }
}
